#if !defined(_APP_MESSAGE_)
#define _APP_MESSAGE_

typedef enum{
    CONN_NONE,
    CONE_BT,
    CONN_LORA,
    COMM_CAN
}ConnectionTYPES;

typedef struct{
    ConnectionTYPES conn_type;
    char* payload;
    int id_len;
    int msg_len;
}Message;

Message * app_messsage_initByBinary(char *binary,int len);

Message * app_messsage_initByJson(char *json);

int app_message_toBinary(Message *message,char *binary,int len);

int app_message_toJson(Message *message,char *json,int len);

void app_message_free(Message *message);

#endif // _APP_MESSAGE_
